package com.jinlia.show.modules.wxapp.controller;

import com.jinlia.show.modules.base.system.entity.MdArticle;
import com.jinlia.show.modules.base.system.service.MdArticleMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mk/article")
public class MdArticleController {

    @Autowired
    private MdArticleMapperService mdArticleMapperService;

    @PostMapping("/byName")
    public MdArticle list(@RequestBody MdArticle swiperImgs) {
        MdArticle one = mdArticleMapperService.lambdaQuery()
                .eq(MdArticle::getTitle, swiperImgs.getTitle())
                .last("limit 1")
                .one();
        return one;
    }

}
